home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1980-05-16 | 3.1 KB | 55 lines |
- '*********************SPRITES-WHO NEEDS EM?-By Mark Wickson**********************
- Rem Personally,I hate using sprites,because Bobs are so much easier to use,
- Rem even though this is the way you're supposed to display Sprites,it
- Rem looks decidedly odd,as you'll see.
- Rem After you have loaded the sprites in the usual way(See elsewhere for
- Rem details of loading files),you have to use the "Get Sprite Palette"
- Rem command to make sure they are the colours you defined them.
- Rem next we place the sprite of our choice on screen,theres no limitation
- Rem to the number of sprites,only that you can't have more than 8 at the
- Rem same horizontal position.
- Rem The first number after the word Sprite is the Sprite number,this is
- Rem important if you're going to have more than one sprite on screen at
- Rem a time,this is so you can have several objects on screen at a time
- Rem but make each one do different things-So each sprite you have on screen
- Rem must have a different number-Its easiest to increase the number by 1
- Rem for every new sprite.so if you were going to use sprite 1 you'd write:
- Rem Sprite 1,
- Rem The next number is the Sprites horizontal position on the current screen,
- Rem so for this current screen the number can be anything between 0 and
- Rem 320-If you wanted to put it on the right hand side,you'd set it around
- Rem 300,if you wanted it to be on the left hand side,you'd set it around
- Rem 20,and the centre is roughly 150-But you can put it any where within
- Rem these limits,lets imagine we want it in the centre,so we type:
- Rem Sprite 1,150,
- Rem The next number is the vertical position of the sprite on the current
- Rem screen,so for this current screen the number can be anything between
- Rem 0 and 256-If you want it near the top,you'd set it around 10,if you
- Rem wanted it in the centre,110 is approximately right,and the bottom of
- Rem the screen would be around 230,but as above,you're free to set it
- Rem anywhere within the limits of the screen.Like this:
- Rem Sprite 1,150,110,
- Rem The final number is the IMAGE number of the Sprite,don't confuse this
- Rem with the Sprite number-This is what affects the visual aspect of the
- Rem sprite-Not the sprite itself(In the Sprite bank maker,you aren't actually
- Rem defining the Sprites as such,but the images that ANY of them can have)
- Rem If you have created 10 images in your Sprite bank and want to use
- Rem the first image for the first sprite,you'd write:
- Rem Sprite 1,150,110,1
- Rem But if you wanted sprite 1 to use the fifth image in the bank,you'd write:
- Rem Sprite 1,150,110,5
- Rem So you can use any image number that you want with any sprite-You can even
- Rem have several different sprites with the same image number.
- Rem In our example we use the "Wait Vbl" command which makes AMOS wait until
- Rem the screen has `drawn' itself before progressing-Because our program is so
- Rem small if you took that instruction the sprite wouldn't even appear-You
- Rem don't have to include this command in larger programs or ones that have
- Rem commands after the "Sprite" command.
- Screen Open 0,320,256,16,Lowres
- Flash Off
- Curs Off
- Cls 0
- Load "ATTBG:JUMP.Abk"
- Get Sprite Palette
- Sprite 1,150,110,1
- Wait Vbl